package cloud.estate.activity.controller;

import cloud.estate.activity.service.ActivityService;
import cloud.estate.commons.bean.Activity;
import cloud.estate.commons.util.JsonResult;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/activity")
public class ActivityController {
    @Resource
    private ActivityService activityService;
    @PostMapping("/addOneActivity")
    public JsonResult AddOneActivity(Activity activity) {
        return activityService.addOneActivity(activity);
    }
    @PostMapping("/deleteOneActivity/{id}")
    public JsonResult DeleteOneActivity(@PathVariable("id") String id) {
        return activityService.deleteOneActivity(id);
    }
    @PostMapping("/updateOneActivity")
    public JsonResult UpdateOneActivity(Activity activity) {
        return activityService.updateOneActivity(activity);
    }
    @GetMapping("/findOneActivity/{id}")
    public JsonResult FindOneActivity(@PathVariable("id") String id) {
        return activityService.findOneActivity(id);
    }
    @GetMapping("/findAllActivity")
    public JsonResult FindAllActivity() {
        return activityService.findAllActivity();
    }
}
